package sesion;

//~--- JDK imports ------------------------------------------------------------

import java.sql.*;

/*
* SessionListener.java
*
* Created on October 24, 2007, 9:29 AM
*
* To change this template, choose Tools | Template Manager
* and open the template in the editor.
 */
import javax.servlet.http.*;

/**
 *
 * @author Luis
 */
public class SessionListener implements HttpSessionListener {

    /** Creates a new instance of SessionListener */
    public SessionListener() {}

    public void sessionCreated(HttpSessionEvent sessionEvent) {
        ;
    }

    public void sessionDestroyed(HttpSessionEvent sessionEvent) {

        // Get the session that was invalidated
        HttpSession session = sessionEvent.getSession();

        // Cierra la conexi�n de la base de datos establecida por el usuario
        try {
            Connection con = (Connection) session.getAttribute("ConexionBd");

            con.close();
        } catch (Exception e) {
            ;
        }
    }
}


//~ Formatted by Jindent --- http://www.jindent.com
